package br.com.intelsys.iflow.driver.struts;

import java.util.ArrayList;
import java.util.List;

class CfgProcess {
	private String name;
	private List <CfgTransition> transitionList;
	
	CfgProcess (String name) {
		this.name = name;
	}

	String getName() {
		return (this.name);
	}
	
	List<CfgTransition> getTransitionList() {
		return (transitionList);
	}
	void addTransition(CfgTransition transition) {
		if (this.transitionList == null) {
			this.transitionList = new ArrayList <CfgTransition>();
		}
		this.transitionList.add(transition);
	}
	
	CfgTransition getCfgTransition(String transitionName) {
		CfgTransition cfgTr = null;
		for (CfgTransition t : this.transitionList) {
			if (t.containsName(transitionName)) {
				cfgTr = t;
				break;
			}
		}
		return (cfgTr);
	}
}
